package org.ovhoo.zonfig;

import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class ZonfigErrorHandler implements ErrorHandler{

	//valide or not
	private boolean valide = true;
	
	@Override
	public void error(SAXParseException arg) throws SAXException {
		System.out.println("ZonfigErrorHandler XSD Validation Error (" + arg.toString()  +")");
		this.valide = false;
	}

	@Override
	public void fatalError(SAXParseException arg) throws SAXException {
		System.out.println("ZonfigErrorHandler XSD Fatal Validation Error (" + arg.toString()  +")");
		this.valide = false;
	}

	@Override
	public void warning(SAXParseException arg) throws SAXException {
		System.out.println("ZonfigErrorHandler XSD Validation Warning (" + arg.toString()  +")");
		this.valide = false;
	}
	
	
	public boolean isValide(){
		return this.valide;
	}
}
